import random

# 参与游戏的角色有两个（玩家 与 电脑），玩家手工出拳，电脑随机出拳，根据石头剪刀布判断输赢。
# 玩家：player（玩家手工输入石头0、剪刀1、布2）
# 电脑：computer（随机出拳）


# player = int(input('录入石头0、剪刀1、布2'))
# computer = 1
# if (player == 0 and computer == 1) or (player == 1 and computer == 2) or (player == 2 and computer == 0):
#     print('玩家胜利')
# elif player == computer:
#     print('平局')
# else:
#     print('电脑胜利')
# print('----------游戏结束------------')


# 使用随机数让电脑随机出拳
player = int(input('录入石头0、剪刀1、布2'))
computer = random.randint(0,2) # 电脑会在0~2之间随机出拳.
print(computer)
if (player == 0 and computer == 1) or (player == 1 and computer == 2) or (player == 2 and computer == 0):
    print('玩家胜利')
elif player == computer:
    print('平局')
else:
    print('电脑胜利')
print('----------游戏结束------------')

